package com.ougy.reshop.action;

import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component("login")
@Scope("prototype")
public class LoginAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2640880425158062342L;
	private static final Logger logger = Logger.getLogger(LoginAction.class);
	private String login_username;
	private String login_password;

	public String getLogin_username() {
		return login_username;
	}

	public void setLogin_username(String login_username) {
		this.login_username = login_username;
	}

	public String getLogin_password() {
		return login_password;
	}

	public void setLogin_password(String login_password) {
		this.login_password = login_password;
	}

	public String loggingin() throws Exception {

		this.notice = this.sUser.login(login_username, login_password);
		if (this.notice.isStatus()) {
			return "success";
		}
		return "failure";
	}

	public String logout() throws Exception {
		this.session.clear();
		return "success";
	}
}
